import request from '@/utils/request'

// 借入借出开始
export function getLoanNotes(params) {
  return request({
    url: '/document/loan_note/',
    method: 'GET',
    params
  })
}

export function addLoanNote(data) {
  return request({
    url: '/document/loan_note/',
    method: 'POST',
    data
  })
}

export function updateLoanNote(data) {
  return request({
    url: `/document/loan_note/${data.id}/`,
    method: 'PATCH',
    data
  })
}

export function delLoanNote(data_id) {
  return request({
    url: `/document/loan_note/${data_id}/`,
    method: 'DELETE',
  })
}

export function delLoanNotes(data) {
  return request({
    url: '/document/loan_note/batch_delete/',
    method: 'DELETE',
    data
  })
}


export function createNotes(data, onDownloadProgress) {
  return request({
    url: '/document/loan_note/create_note/',
    method: 'POST',
    data,
    responseType: 'blob',
    onDownloadProgress
  })
}
// 借入借出结束
